/*
 * @Author: wjk
 * @Date: 2020-01-03 11:37:21
 * @LastEditors: wjk
 * @LastEditTime: 2020-02-17 10:43:30
 * @description: file content
 */
import { requestNew } from '@/utils/request'

// 获取优惠券列表
export async function getCouponList(params, option = {}) {
  const res = await requestNew({
    url: '/coupon/list',
    method: 'post',
    data: params || {},
    headers: {
      'showLoading': true,
      'showMessage': true,
      ...option
    }
  })
  return res
}
// 获取礼包列表
export async function myCouponList(params) {
  const res = await requestNew({
    url: '/coupon/list/personal',
    method: 'post',
    data: params || {}
  })
  return res
}

// 获取礼包列表
export async function receiveCoupon(params) {
  const res = await requestNew({
    url: '/coupon/receive',
    method: 'post',
    data: params || {}
  })
  return res
}

// 获取礼包列表
export async function unusedCoupon(params, option = {}) {
  const res = await requestNew({
    url: '/coupon/list/unused/count',
    method: 'post',
    data: params || {},
    headers: {
      'showLoading': true,
      'showMessage': true,
      ...option
    }
  })
  return res
}
